import { Module } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { getConfiguration } from './config/resources/getConfiguration'
import { SharedModule } from './shared/shared.module'

const libModules = [
  ConfigModule.forRoot({
    isGlobal: true,
    load: [getConfiguration],
    envFilePath: [`.env.${process.env.NODE_ENV}`],
  })
]

const customModules = [
  SharedModule
]

@Module({
  imports: [
    ...libModules,
    ...customModules,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
